<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";
	
	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	checkAccess("allow_content_management",1);
	if(empty($_GET['type']))
	{
		$type=2;
	}else{
	
		$type=$_GET['type'];
	}
	
	if($type==2)
	{
		$title="News and Events";
	}else{
		$title="Information";
	}
	
	
	$get_news=mysql_query("select * from os_news where type=$type order by type asc, create_date desc");
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	

	<td valign="top">
		<div class="title"><?= $title ?></div> 
        <br>
			<table width="100%" class="solidborder">
				<tr class="table_header">
					<td width="3%">No</td><td width="48%">Title </td><td width="14%">Created Date</td><td width="16%">Show</td><td width="8%">System ID</td><td width="11%">Action</td>
				</tr>
				<? if(mysql_num_rows($get_news)==0){ ?>
				<tr valign="top">
					<td align="center" colspan="7">
					- No record found - 
					</td>
				
				<? 
					}
					else
					{
						$no=1;
						while($a=mysql_fetch_array($get_news,MYSQL_ASSOC))
						{
							$enid=en_id($a['id']);
							if($no%2==0)
							{
								$class1="table_item_even";
								$class2="table_item_odd";
							}
							else
							{
								$class1="table_item_odd";
								$class2="table_item_even";
							}
							
							if($a['status']==0)
							{
								$status="No";
							}
							else
							{
								$status="Yes";	
							}
							
							
							
			
			
							
				?>
			   <tr height="20" valign="top" class="<?= $class1 ?>" onmouseover="this.className='table_item_mouseover'" 
                            onmouseout="this.className='<?= $class1 ?>'">
						<td align="center"><?= $no ?></td>
						<td>
						<?= $a['title_eng'] ?><br><a href="<?= $a['url_eng'] ?>" target="_blank"><?= $a['url_eng'] ?></a><br>
						
						</td>
						
						<td><?= $a['create_date'] ?></td>
						<td><?= $status ?></td>
						<td><?= $a['id'] ?></td>
						<td align="center"><a href="events_edit.php?id=<?= $enid ?>"><img src="images/icons/edit.gif" border="0"></a>  <a href="events_delete.php?id=<?= $enid ?>"><img src="images/icons/delete.gif" border="0"></a></td>								
			  </tr>
				<? 
					$no++; 
						}
					}
				?>
				
			</table>
			
		<table>
			
			<tr>
				<td colspan="3"><input type="button" value="Add Record" class="button" onClick="window.open('events_add.php?type=<?= $type ?>','_self')"></td>
			</tr>
		</table>
		
		
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

